<template>
	<div id='tmpl'>
		<ul class="mui-table-view">
				<li v-for='item in list' class="mui-table-view-cell mui-media">
					<router-link v-bind="{to:'./newsinfo/'+item.id}">
						<img class="mui-media-object mui-pull-left" :src="item.img_url">
						<div class="mui-media-body">
							<span class="title_1">{{item.title}}</span>
							<p class='mui-ellipsis' v-text='item.zhaiyao'></p>
							<div class="zhushi">
								<span>{{item.add_time | datefmt('YYYY-MM-DD H:mm:ss')}}</span>
								<span class='last_span'>点击率:{{item.click}}</span>
							</div>
						</div>
					</router-link>
				</li>
			</ul>
	</div>
</template>
<script>
		import { Toast } from 'mint-ui';
	export default{
		data(){
			return{
				list:[]
			}
		},
		created(){
			this.getslist()
		},
		methods:{
			getslist(){
			// 1.0 静态写死数据	
				this.list=[
					{
						'id':1,
						'title':'1季度多家房企利润跌幅50% 打响去库存战',
						'add_time':'2015-04-16T12:50:28+08:00',
						'zhaiyao':'房企一季度销售业绩已经陆续公布，统计',
						'click':1,
						'img_url':'../../../statics/images/shuijiao.jpg'
					},
										{
						'id':2,
						'title':'2季度多家房企利润跌幅50% 打响去库存战',
						'add_time':'2015-04-16T12:50:28+08:00',
						'zhaiyao':'房企一季度销售业绩已经陆续公布，统计',
						'click':2,
						'img_url':'../../../statics//images/muwu.jpg'
					},
					{
						'id':3,
						'title':'3季度多家房企利润跌幅50% 打响去库存战',
						'add_time':'2015-04-16T12:50:28+08:00',
						'zhaiyao':'房企一季度销售业绩已经陆续公布，统计',
						'click':3,
						'img_url':'../../../statics/images/cbd.jpg'
					}
				]
			}
			// 2.0 动态获取数据
			// var url=''，
			// this.$http.get(url).then(function(res){
			// 	var body=res.body;
			// 	if(body.status != 0){
			// 		Toast(body.message);
			// 		return;
			// 	}
			// 	this.list=body.message;
			// });
		}
	}
</script>
<style scoped>
	.mui-table-view-cell img{
		width:80px;
		height:80px;
	}
	.mui-table-view .mui-media-object{
		max-width:80px;
		max-height:80px;
	}
	.title_1{
		overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
		display: inline-block;
		width:90%}
	.zhushi{
			font-size:14px; 
			padding-top: 1em;
			color:rgb(38,162,255);
		}
	.last_span{
		margin-left:2.5em;
	}
</style>